﻿<?xml version="1.0" encoding="UTF-8"?>
<!--
/// 
/// MaDAson - Toolkit for Model Driven Software Development
///
/// Copyright [2006] Marcus Lankenau
/// 
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///  
///     http://www.apache.org/licenses/LICENSE-2.0
///  
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
/// 
-->
<%@ Page Language="C#" %>
<%@ Import Namespace="Madason.MetaModel" %>
<%@ Import Namespace="Madason.MetaModel.Maven" %>
<%@ Import Namespace="Madason.GenUtils" %>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId><%= Project.GroupId %></groupId>
	<version><%= Project.Version %></version>
	<artifactId><%= Project.ArtifactId %></artifactId>
	<packaging><%= Project.Packaging %></packaging>
	<name><%= Project.ArtifactId %></name>
<% if (Project.SubProjects.Count > 0) { %>
	<modules>
<%   foreach (MavenProject project in Project.SubProjects) { %>	
		<module><%= project.ArtifactId %></module>
<%   } %>
		
		<%= ProtectedSection.GenForXml("user_submodules")%>
	</modules>
	<properties>
		
		<%= ProtectedSection.GenForXml("user_properties")%>
	</properties>

	
<% } %>	
<% if (Project.ParentProject != null) { %>
	<parent>
		<groupId><%= Project.ParentProject.GroupId %></groupId>
		<artifactId><%= Project.ParentProject.ArtifactId %></artifactId>
		<version><%= Project.ParentProject.Version %></version>
	</parent>
<% } %>
	<build>
		<finalName><%= Project.ArtifactId %></finalName>

		<plugins>
		
<%= Project.Plugins %>
		<%= ProtectedSection.GenForXml("user_plugins")%>
		</plugins>
	</build>
	<reporting>
		
		<%= ProtectedSection.GenForXml("user_reporting")%>
	</reporting>
	
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>	
<% foreach (MavenDependency dep in Project.MavenDependencies) { %>	
		<dependency>
			<groupId><%= dep.GroupId %></groupId>
			<artifactId><%= dep.ArtefactId %></artifactId>
			<version><%= dep.Version %></version>
<% if (dep.Scope != "") { %>
			<scope><%= dep.Scope %></scope>		
<% } %>
		</dependency>
<% } %>
		
		<%= ProtectedSection.GenForXml("user_dependencies")%>
	</dependencies>

	<repositories>
		
		<%= ProtectedSection.GenForXml("user_repositories")%>
	</repositories>	

	<profiles>
		
		<%= ProtectedSection.GenForXml("user_profiles")%>
	</profiles>		
</project>
<script runat="server">
	private MavenProject project;

	public MavenProject Project
	{
		get { return project; }
		set { project = value; }
	}		
	
	private ProtectedSections protectedSection;

	public ProtectedSections ProtectedSection
	{
		get { return protectedSection; }
		set { protectedSection = value; }
	}	
</script>
